<template>
  <div>
      <ul class="mui-table-view">
        <li class="mui-table-view-cell mui-media" v-for="item in newslist">
			<router-link to="/home/newsinfo">
				<img class="mui-media-object mui-pull-left" src="../../common/images/shuijiao.jpg">
				<div class="mui-media-body">
					<h2>{{item.content}}</h2>
				<p class='mui-ellipsis'>
                    <span>发表时间:{{item.time}}</span>
                    <span>点击:0次</span>
                </p>
				</div>
			</router-link>
		</li>
      </ul>
  </div>
</template>

<script>
import {Toast} from 'mint-ui'
export default {
  data() {
      return {
          newslist:[]
      }
  },
  created(){
      this.$http.get('api/getnewslist').then(res=>{
          var data = res.body;
          if(data.status === 0) {
              this.newslist = data.message;
          }else {
              Toast('加载失败')
          }
      })
  }
}
</script>

<style lang="scss" scoped>
.mui-table-view {
    li {
        h2{
            font-size: 14px;
        }
    }
}

.mui-ellipsis {
    font-size: 12px;
    color: skyblue;
    display: flex;
    justify-content: space-between;
}

</style>
